<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<title>工资信息管理系统</title>
		<link rel="stylesheet" type="text/css" href="js/layui/css/layui.css" />
		<link rel="stylesheet" type="text/css" href="css/style.css" />
		<script src="js/jquery-2.0.0.min.js" type="text/javascript" charset="utf-8"></script>
		<script src="js/layui/layui.js" type="text/javascript" charset="utf-8"></script>
		<script src="js/isLoginAdmin.js" type="text/javascript" charset="utf-8"></script>
	</head>
	<body>

		<div class="layui-layout layui-layout-admin">
			<div class="layui-header">
				<div class="layui-logo" style="font-size: 26px;color: white;">管理员</div>
				<ul class="layui-nav layui-layout-right">
					<li class="layui-nav-item"><a id="adminName" href="" style="font-size: 20px;">管理员1</a></li>
					<li class="layui-nav-item" id="quitLogin"><a class="layui-icon" style="cursor: pointer;" title="退出">&#xe682;</a></li>
				</ul>
			</div>

			<div class="layui-side layui-bg-black">
				<div class="layui-side-scroll">
					<!-- 左侧导航区域（可配合layui已有的垂直导航） -->
					<ul class="layui-nav layui-nav-tree" lay-filter="test">
						<li class="layui-nav-item layui-this"><a href="admin_sector.html" target="content">部门管理</a></li>
						<li class="layui-nav-item"><a href="admin_add.html" target="content">添加员工信息</a></li>
						<li class="layui-nav-item"><a href="admin_manage.html" target="content">管理员工信息</a></li>
						<li class="layui-nav-item"><a href="admin_publish.html" target="content">发布工资信息</a></li>
						<li class="layui-nav-item"><a href="admin_changepassword.html" target="content">修改账户密码</a></li>
					</ul>
				</div>
			</div>

			<div class="layui-body" style="display: flex;height: calc(100vh - 60px);">
				<!-- 内容主体区域 -->
				<iframe src="admin_sector.html" frameborder="0" name="content" style="flex: 1;"></iframe>
			</div>
		</div>
		<script>
			//JavaScript代码区域
			layui.use(['layer','element'], function() {
				var element = layui.element;
				
				$("#quitLogin").click(function(){
					$.ajax({
						url: "quitLoginAdmin",
						type: 'POST',
						data: {
							
						},
						success: function(result) {
							layer.msg('退出成功');
							window.open("login.html","_self");
						},
						error: function(e) {
							console.log(e.status);
							layer.msg('退出失败');
						}
					});
				});
				
				// 获取当前管理员名
				$.ajax({
						url: "getAdminName",
						type: 'POST',
						data: {
							
						},
						success: function(result) {
							$("#adminName").html(result);
						},
						error: function(e) {
							console.log(e.status);
							layer.msg('管理员名获取失败');
						}
				});
				
			});
		</script>

	</body>
</html>
